import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          body: MyHomePage(),
        appBar: AppBar(title: Text("111"),),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Expanded(child: ListView.separated(itemBuilder: (context,index){
          return TestWidget(index: index);
        }, separatorBuilder: (context,index){
          return Container();
        }, itemCount: 1000,addAutomaticKeepAlives: false,addRepaintBoundaries: false,))
      ],
    );
  }
}

class TestWidget extends StatefulWidget {
  final int index;

  const TestWidget({super.key, required this.index});
  @override
  State<StatefulWidget> createState() {
    return TestWidgetState();
  }

}

class TestWidgetState extends State<TestWidget> {


  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 100,
      height: 100,
      margin: EdgeInsets.all(10),
      color: Colors.green,
      child: Text(widget.index.toString()),
    );
  }
}